package com.cc.springboot_test.config;

import com.cc.springboot_test.listener.LogMonitorListener;
import com.cc.springboot_test.monitor.LogMonitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SerletListenerConfig {


    @Bean
    public ServletListenerRegistrationBean asyncLogMonitorListener() {
        LogMonitorListener listener = new LogMonitorListener();
        ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
        bean.setListener(listener);
        return bean;
    }

}
